<template>
  <div>
      <template>
        <el-table border :data="wenzobj" style="width: 100%">
          <el-table-column prop="title" label="标题" width="100">
          </el-table-column>
          <el-table-column prop="description" label="摘要" width="120"></el-table-column>
          <el-table-column prop="keywords" width="100" label="关键字"></el-table-column>
          <el-table-column prop="content" label="正文" class="hiddenOverText"></el-table-column>
          <el-table-column fixed="right" label="操作" width="100">
            <template slot-scope="scope">
              <el-button type="text" size="small" @click="shanchu(scope.row.id)">删除</el-button>
              <el-button type="text" size="small" @click="chuanid(scope.row.id)">编辑</el-button>
            </template>
          </el-table-column>
        </el-table>
      </template>

  </div>
</template>

<script>
import axios from "axios";
export default {
  name: "wdwz",
  inject:['reload'],
  mounted() {
    this.xianshi();
  },
  data() {
    return {
      wenzobj:[]
    }
  },
  methods: {
    xianshi(){
      let that=this;
      axios.post(
          'http://localhost:9090/api/Member/MemberFaBu'
          /*this.$qs.stringify({UserName:that.formLogin.UserName,Password:that.formLogin.Password})*/
      ).then(function (response) {
        // that.wenzobj = [];
        // for(var i=0;i<response.data.length;i++){
        //   that.wenzobj.push(response.data[i]);
        // }
        that.wenzobj=response.data;
      })
    },
    chuanid(id){
      localStorage.setItem('iid',id)
      this.$router.push({'path':'/loginH/bjwz'})
    },
    shanchu(id){
      let that=this;
      if(confirm('是否删除')){
        axios.post(
            'http://localhost:9090/api/Member/WenzShanChu',
            this.$qs.stringify({id:id}),
        ).then(function (response) {
          that.reload()
        })
      }

    }
  }

}
</script>

<style scoped lang="less">
.hiddenOverText{
  overflow: hidden;
  text-overflow:ellipsis;
  white-space: nowrap;
}
</style>